package string;

/**
 * String substring(int start,int end);
 */
public class SubStringDemo {
    public static void main(String[] args) {
        String str = "www.sss.cn";
        int start = str.indexOf(".")+1;
        int end = str.indexOf(".",start);
        System.out.println("start="+start+",end="+end);
        String name = str.substring(start,end);//表示截取下标4-7的字符串
        System.out.println(name);
    }
}
